A = imread('cameraman.tif');
B = double(A);

X = zeros(size(B));
Y = zeros(size(B));

alpha = 0.5;

for i = 1 : size(A,1)
    X(i,:) = frft(B(i,:),alpha);
end

%figure,imshow(mat2gray(abs(X)));

for i = 1 : size(A,2)
    Y(:,i) = frft(X(:,i),alpha);
end

Y = im2uint8(mat2gray(log(1+abs(Y))));

figure,imshow(Y);


T = dFRT(256,alpha);

M = T*B*T;

if(alpha >= 0.5)
    M = fftshift(M);
end

M = im2uint8(mat2gray(log(1+abs(M))));

figure,imshow(M);

F = fft2(B);

figure,imshow(fftshift(mat2gray(abs(log(1+abs(F))))));

